package com.tianjia.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tianjia.entity.Company;
import com.tianjian.dao.impl.CompanyDaoImpl;

public class HeadServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		CompanyDaoImpl cdi = new CompanyDaoImpl();//创建对象
		Company a = cdi.getCompany();//通过打点方式,调用方法获得
		request.setAttribute("a", a);//存数据
		request.getRequestDispatcher("head.jsp").include(request, response);//转发
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
